import request from "@/utils/request";

// 获取商品列表
export const getGoodsList = (parmsObj) => {
  const { categoryId, goodsName, page } = parmsObj;
  return request.get("/goods/list", {
    params: {
      categoryId,
      goodsName,
      page,
    },
  });
};

// 商品全部分类
export const getCategoryData = () => {
  return request.get("/category/list");
};

// 商品详情页
export const getGoodsDetail = (goodsId) => {
  return request.get("/goods/detail", {
    params: {
      goodsId,
    },
  });
};
// 获取商品评论
export const getGoodsComment = (goodsId, limit) => {
  return request.get("/comment/listRows", {
    params: {
      goodsId,
      limit,
    },
  });
};
